home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: Trying to do weird function overloading
- Date: 26 Feb 1996 11:31:51 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4gs5n7$bc5@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe18.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Feb 26, 1996 00:36:31 in article <Trying to do weird function
- overloading>, 'millert@scheifler.csee.usf.edu (Timothy Miller)' wrote:
-
-
- >Ok... here's a piece of one of my classes:
- >
- >friend Color scale(Color c1, double f);
- >friend Color scale(double f, Color c2);
- >Color scale(double f) { return scale(*this, f); }
- >
- >In the member function, I'm trying to call the friend function, but the
- >compiler is thinking that I'm trying to call the member function. Now,
- >if I were trying to do this the other way around, I could use the scope
- >resolution operator to tell the friend function that I'm trying to access
-
- >the member function (even though I wouldn't need to, right?). But here,
- >I'm trying to do the exact opposite... so how would I scope resolve
- outward?
- >
- You can use the scope resolution operator in your case also.
- ::Color(...)
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-